<!DOCTYPE html>
<html lang="en"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <meta charset="UTF-8">
    <title>图书管理系统</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <style>
        nav {
            font-size: 1.5rem;
            background-color: #21D4FD;
            background-image: -webkit-linear-gradient(19deg, #21D4FD 0%, #B721FF 100%);
            background-image: -moz-linear-gradient(19deg, #21D4FD 0%, #B721FF 100%);
            background-image: -o-linear-gradient(19deg, #21D4FD 0%, #B721FF 100%);
            background-image: linear-gradient(19deg, #21D4FD 0%, #B721FF 100%);
        }
        h1 {
            font-size: 2rem;
        }
        li {
            margin: 10px 20px;
        }
        body {
/*             background-image: url("../static/img/2.jpg"); */
            background-size: cover;
        }
    </style>
</head>
<body>
    <nav class="navbar navbar-expand-sm bg-primary navbar-dark">
        <ul class="navbar-nav" sec:authorize="hasRole('ADMIN')">
            <li>
                <h1><a th:href="@{/}" style="color: white; text-decoration: none">图书管理系统</a></h1>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/admin/book/getAll}">图书管理</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/admin/reader/getAll}">读者管理</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/admin/record/getAll}">借还管理</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{#}">音乐播放</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/admin/book/borrow/getAll}">借书申请表</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{http://127.0.0.1:8081/}">咨询聊天室</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{https://www.bilibili.com/}">百度</a>
            </li>
        </ul>

        <ul class="navbar-nav" sec:authorize="hasRole('USER')">
            <li>
                <h1><a th:href="@{/}" style="color: white; text-decoration: none">图书管理系统</a></h1>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/user/book/getAll}">图书信息</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/user/record/getOwnRecord}">借阅记录</a>
            </li>

        </ul>
        <div class="text-white" style="font-size: medium; position: absolute; bottom: 30px; right: 40px">
            <div class="dropdown">
                <a class="dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
                        th:text="${session.name}+', 您好'">
                </a>
                <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
                    <a class="dropdown-item" th:href="@{/user/toInfoPage}" sec:authorize="hasRole('USER')">个人信息</a>
                    <a class="dropdown-item" th:href="@{/toChPwdPage}">修改密码</a>
                    <a class="dropdown-item" th:href="@{/logout}">注销</a>
                </div>
            </div>
        </div>
    </nav>

    <div class="card bg-light" style="margin: 150px 100px; width: 400px;">
        <div class="card-header">
            <h1>欢迎使用图书管理系统</h1>
        </div>
        <div class="card-body">
            <p>
                后端框架: SpringBoot <br>
                HTML模板: ThymeLeaf <br>
                持久层: Mybatis <br>
                UI: Bootstrap <br>
                登录验证和用户权限: SpringSecurity
            </p>
        </div>
    </div>


<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
</body>
</html>